package main

import (
	"fmt"
	"github.com/garyburd/redigo/redis"
	. "github.com/gomodule/redigo/redis"
)

func main() {
 	rds_conn,err:= Dial("tcp","127.0.0.1:6379")
	if err!=nil {
		fmt.Println("链接redis失败")
		return
	}

	defer rds_conn.Close()
 	res,err:=rds_conn.Do("set","abc",111)
	if err != nil {
		fmt.Println("写入失败,err:",err)
		return
	}

	getData,err:=redis.String(rds_conn.Do("get","abc"))
	if err != nil {
		fmt.Println("读取失败,err:",err)
		return
	}
	fmt.Println(getData)
	fmt.Println(res)
}
